package pattern.behavioral.strategy.simple;

import java.math.BigDecimal;

/**
 * @author: chaoyang.ren  
 * @date:Jun 1, 2017  
 * @time:4:36:42 PM   
 * @email:chaoyang.ren@foxmail.com  
 * @version: 1.0
 */
public class Price {
	private BigDecimal price;
	private PriceStrategy priceStrategy;
	
	public Price(BigDecimal price) {
		super();
		this.price = price;
	}

	public BigDecimal calculatePrice(){
		return priceStrategy.getPrice(price);
	}
	
	public BigDecimal getPrice() {
		return price;
	}
	public void setPrice(BigDecimal price) {
		this.price = price;
	}
	public PriceStrategy getPriceStrategy() {
		return priceStrategy;
	}
	public void setPriceStrategy(PriceStrategy priceStrategy) {
		this.priceStrategy = priceStrategy;
	}
	
}

